home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1221 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: void pointers
  5. Date: 12 Jan 1996 05:41:39 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Jan11224139@qcd.lanl.gov>
  8. References: <1996Jan12.133322.1@ccc.govt.nz>
  9. NNTP-Posting-Host: qcd.lanl.gov
  10. Mime-Version: 1.0
  11. Content-Type: text
  12. In-reply-to: mcauslanb@ccc.govt.nz's message of 12 Jan 96 13:33:22 NZDT
  13.  
  14. --text follows this line--
  15. In article <1996Jan12.133322.1@ccc.govt.nz> mcauslanb@ccc.govt.nz
  16. writes: 
  17. <snip>
  18.    I am writing a C program for an application that has a development language 
  19.    based on ANSI C.
  20.  
  21.    A function that I need to call is defined:
  22.        void getFence (void **clipPP);
  23.  
  24.       where "clipPP" is returned by the function.
  25.  
  26.    1) How do I declare and pass clipPP?
  27.  
  28. Depends on the documentation of the function. Maybe something like
  29.  
  30. void *clipPP; /* may be required to be initialized */
  31. getFence (&clipPP);
  32.  
  33. or, it may be something like
  34.  
  35. void **clipPP = 0 /* or maybe some other pointer value */ ;
  36. getFence (clipPP);
  37.  
  38. etc. etc. etc.
  39.  
  40.    2) What is actually going on?
  41.  
  42. It is accepting the address of an object which can store an arbitary
  43. data pointer. Note that it is the object whose address is passed which
  44. can store an arbitrary data pointer. Do not confuse this with a
  45. function that can take an arbitrary data pointer.
  46.  
  47. Cheers
  48. Tanmoy
  49. --
  50. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  51. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  52. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  53. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  54. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  55. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  56.